//
//  MoneyDetailCell.m
//  QoilPublic
//
//  Created by SunChao on 2018/2/2.
//  Copyright © 2018年 孙超. All rights reserved.
//

#import "MoneyDetailCell.h"
@interface MoneyDetailCell()
@property (weak, nonatomic) IBOutlet UILabel *moneyType;
@property (weak, nonatomic) IBOutlet UILabel *moneyCount;
@property (weak, nonatomic) IBOutlet UILabel *date;




@end
@implementation MoneyDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.moneyCount.textColor = [UIColor colorWithRed:51.0/255 green:51.0/255 blue:51.0/255 alpha:1.0f];
    self.moneyType.textColor =  [UIColor colorWithRed:51.0/255 green:51.0/255 blue:51.0/255 alpha:1.0f];
    self.date.textColor = [UIColor colorWithRed:153.0/255 green:153.0/255 blue:153.0/255 alpha:1.0f];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setCellWithData:(NSDictionary *)dic{
    
    
    self.moneyCount.text = [NSString stringWithFormat:@"%@元",[dic objectForKey:@"amount"]];
    self.date.text = [dic objectForKey:@"createtime"];
    if ([dic.allKeys containsObject:@"amount"]) {
        
        
        if ([[dic objectForKey:@"serviceType"]isEqualToString:@"1"]) {//充值记录
            self.moneyType.text = @"充值";
            self.moneyCount.textColor = [UIColor colorWithRed:28.0/255.0 green:172.0/255 blue:25.0/255 alpha:1.0f];
           
        }
        
        if ([[dic objectForKey:@"serviceType"]isEqualToString:@"2"]) {//加油记录
            self.moneyType.text = @"加油";
             self.moneyCount.textColor = [UIColor colorWithRed:51.0/255 green:51.0/255 blue:51.0/255 alpha:1.0f];
        }
        
    }
    
    
}
@end
